Skip to content

CAMEL-23443: camel-pulsar - expose enableBatchIndexAcknowledgment#23485

Merged
davsclaus merged 1 commit into
apache:mainfrom
rkdfx:CAMEL-23443-pulsar-batch-index-ack
May 24, 2026
Merged

CAMEL-23443: camel-pulsar - expose enableBatchIndexAcknowledgment#23485
davsclaus merged 1 commit into
apache:mainfrom
rkdfx:CAMEL-23443-pulsar-batch-index-ack

Conversation

@rkdfx
Copy link
Copy Markdown
Contributor

@rkdfx rkdfx commented May 23, 2026

Description

Adds a new consumer-side URI option enableBatchIndexAcknowledgment to the camel-pulsar
component.

The Pulsar client's ConsumerBuilder supports
enableBatchIndexAcknowledgment(boolean) to allow each message in a batch to be acknowledged
independently. With the option disabled (the Pulsar client default), a single failed
acknowledgment causes the broker to redeliver the entire batch — including messages that were
processed successfully. The component previously built the ConsumerBuilder without invoking
this method and exposed no URI parameter to configure it.

This change:

  • Adds the option as a @UriParam(label = "consumer") field on PulsarConfiguration with
    default false (matches the Pulsar client's own default — no behaviour change for existing
    routes).
  • Wires it into CommonCreationStrategyImpl in the same shape as the existing readCompacted
    option (unconditional pass-through onto the ConsumerBuilder).
  • Adds a default-value assertion to PulsarComponentTest.testPulsarEndpointDefaultConfiguration
    and a new URI-parsing test testPulsarEndpointEnableBatchIndexAcknowledgment.

Enabling this option also requires the Pulsar broker to be configured with
acknowledgmentAtBatchIndexLevelEnabled=true for the per-message acknowledgments to take
effect. This is documented in the option's description.

Resolves https://issues.apache.org/jira/browse/CAMEL-23443

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-structured PR. The new enableBatchIndexAcknowledgment consumer option is properly implemented:

  • @UriParam(label = "consumer") with a clear description that documents the broker-side prerequisite (acknowledgmentAtBatchIndexLevelEnabled=true)
  • Default false matches the Pulsar client's own default — no behavior change for existing routes
  • Wired into CommonCreationStrategyImpl consistently alongside the existing readCompacted option
  • Tests cover both the default value assertion and the URI-parsing path
  • All generated files (catalog, configurers, URI factory) are committed

Looks good to merge.

Claude Code on behalf of Guillaume Nodet

@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

Signed-off-by: Ravi <13908473+rkdfx@users.noreply.github.com>
@rkdfx rkdfx force-pushed the CAMEL-23443-pulsar-batch-index-ack branch from 6b50fc8 to a0778d6 Compare May 24, 2026 11:21
@rkdfx
Copy link
Copy Markdown
Contributor Author

rkdfx commented May 24, 2026

I've committed all generated files after running mvn clean install -DskipTests which was missing that's why build failed.

@github-actions github-actions Bot added the dsl label May 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-pulsar
  • dsl/camel-componentdsl
  • dsl/camel-endpointdsl
All tested modules (11 modules)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Component DSL
  • Camel :: Endpoint DSL
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: Pulsar
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@davsclaus davsclaus merged commit 5e310e7 into apache:main May 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants